package com.irdstudio.efp.nls.service.common.rules.apply;

import com.irdstudio.basic.framework.core.constant.EsbRetCodeStandard;
import com.irdstudio.basic.framework.core.exception.BizException;
import com.irdstudio.efp.nls.service.common.rules.CheckRule;

/**
 * 需求编号:2019D08--
 * 问题编号:
 * 开发人员: caoxin
 * 创建日期:2019/12/4
 * 功能描述:
 * 修改日期:2019/12/4
 * 修改描述:
 */
public class GlobalSernoExistRule implements CheckRule {
    private int numberOfRecord;

    public GlobalSernoExistRule(int numberOfRecord) {
        this.numberOfRecord = numberOfRecord;
    }

    @Override
    public void check() throws BizException {
        if (numberOfRecord > 0) {
            throw new BizException(EsbRetCodeStandard.WFJKYWGZ.getValue(), "GlblSrlNo全局流水号已经被使用，请使用新的流水号");
        }
    }
}
